<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<ul  id="side-menu">
</ul>
<script type="text/javascript">
    var Menu = BUI.Menu;
    var data =[
        {
            text: '用户管理',
            items: [
                {
                    text: '用户列表',
                    href: '<%=basePath%>rest/web/toUser',
                    collapsed:true
                }
            ],
        },
        {
            text: '交易管理',
            items: [
                {
                    text: '小鸡交易',
                    href: '<%=basePath%>rest/web/toChickTransaction',
                },
                {
                    text: '小鸡激活',
                    href: '<%=basePath%>rest/web/toChickActive',
                }
                ,
                {
                    text: '鸡蛋交易',
                    href: '<%=basePath%>rest/web/toEggTransaction',
                }
            ],
        }
    ];

    var sideMenu = new Menu.SideMenu({
        render:'#side-menu',
        width:200,
        prefixCls:'xm-',
        itemTpl:'<div class="xm-menu-title">{text}<i class="xm-iconfont">&#xe604;</i></div>',
        collapsedCls:'xm-menu-title',
        subMenuItemTpl : '<a href="{href}">{text}</a>',
        items :data
    });

    sideMenu.render();
    sideMenu.on('menuclick', function(e){
        window.location.href=e.item.get('href');
        console.log(e.item.get('href'));
    });
</script>
